package com.yanqu.road.dataHelper.action.excel;

import com.yanqu.road.dataHelper.gameServer.GameServer;
import com.yanqu.road.dataHelper.repair.BaseRepair;

import javax.crypto.Cipher;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author xx
 * @Date 2020/11/11
 */
public class VehicleXXXX extends BaseRepair {

    public VehicleXXXX(GameServer gameServer) {
        super(gameServer);
    }

    @Override
    public void repair(long param1, String param2) {

    }

    public void go(List<String> list)throws Exception {
        for (String str : list) {
            int begin = str.indexOf("\"");
            int end = str.lastIndexOf("\"");
            String sql = str.substring(begin + 1, end);
            String serverStr = sql.substring(0, 8);
            if (getGameServer().getServerInfo().getServerId() != Integer.parseInt(serverStr)) {
                continue;
            }
            PreparedStatement ps = getGameServer().getConnection().prepareStatement(str);
            ResultSet rs = ps.executeQuery();
            if (rs.next()) {
                String userId = rs.getString("userId");
                String vehicleUid = rs.getString("vehicleUid");
                String templateId = rs.getString("templateId");
                String level = rs.getString("level");
                String studyLv = rs.getString("studyLv");
                getLogger().info("aaaaaaaaaaaa    {}    {}  {}  {}  {}", userId, vehicleUid, templateId, level, studyLv);
            }
        }
    }



}
